﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;

namespace SkyPoint
{
    public class SkyComparator
    {
        Coord coordinate;

        public SkyComparator(Coord _coordinate)
        {
            coordinate = _coordinate;
        }

        public int Compare(Object x, Object y)
        {
            SkyObject starX = x as SkyObject;
            SkyObject starY = y as SkyObject;
            double xDist = Utils.ArcDistance(starX.Coordinates,coordinate);
            double yDist = Utils.ArcDistance(starY.Coordinates,coordinate);

            if(xDist < yDist)
            {
                return -1;
            }
            else if (xDist > yDist)
            {
                return 1;
            }
            else
            {
                return 0;
            }

        }
    }
}
